package com.miniso.robot.feign;

import feign.Logger;
import feign.RequestInterceptor;
import feign.RequestTemplate;
import feign.codec.Encoder;
import feign.form.spring.SpringFormEncoder;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.ObjectFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.http.HttpMessageConverters;
import org.springframework.cloud.openfeign.support.SpringEncoder;
import org.springframework.context.annotation.Bean;

/**
 * @author guojunwang
 * @date 2021-10-18 20:36
 */
@Slf4j
public class RobotFeignConfig  implements RequestInterceptor{

    @Override
    public void apply(RequestTemplate template) {
        log.info("请求体==>{}",template.body());
        log.info("请求头==>{}",template.headers());
    }



    @Bean
    Logger.Level feignLoggerLevel() {
        return Logger.Level.FULL;
    }

}
